<template>
  <div class="child">
    <h1>我是Child组件</h1>
    <input type="checkbox" :checked="tongyi" @click="handleClick">同意协议
  </div>
</template>

<script>
  export default {
    name:'Child',
    props:['tongyi','updateTongyi'],
    methods: {
      handleClick(event){
        console.log(event.target.checked)
        this.updateTongyi(event.target.checked)
      }
    },
  }
</script>

<style scoped>
  .child {
    background-color: orange;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px black;
    font-size: 30px;
  }
  input {
    width: 30px;
    height: 30px;
  }
</style>